package at.ac.tuwien.dse.health.event.annotation;

import java.lang.annotation.*;

/**
 * Marks a method as an event listener, as used by {@link at.ac.tuwien.dse.health.event.bus.EventBus EventBus} and
 * {@link at.ac.tuwien.dse.health.event.listener.EventListener EventListener}.
 * <p/>
 * <p>The type of event will be indicated by the method's first (and only) parameter.  If this annotation is applied to
 * methods with zero parameters, or more than one parameter, the object containing the method will not be able to
 * register for event delivery from the {@link at.ac.tuwien.dse.health.event.bus.EventBus EventBus}.
 *
 * @author Bernhard Nickel
 * @author Gregor Schauer
 * @author Dominik Strasser
 */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Observe {
	Class<?> value() default Observe.class;

	boolean consume() default true;
}
